<?php
/*
 * @Description    : 
 * @Version        : 1.0.0
 * @Author         : QianLong
 * @Date           : 2021-11-18 17:28:19
 * @LastEditors    : QianLong
 * @LastEditTime   : 2022-11-06 10:52:22
 */

return [
    'uri' => env('MONGODB_URI', ""),
    'connect_timeout' => env('MONGODB_CONNECT_TIMEOUT', '3s'),
    "read_write_timeout" => env('MONGODB_READ_WRITE_TIMEOUT', '60s'),
    'default' => [
        'username' => env('MONGODB_USERNAME', 'root'),
        'password' => env('MONGODB_PASSWORD', ''),
        'host' => env('MONGODB_HOST', ''),
        'port' => env('MONGODB_PORT', ''),
        'db' => env('MONGODB_DB', ''),
        'authMechanism' => 'SCRAM-SHA-256',
        //设置复制集,没有不设置
        //'replica' => 'rs0',
        'pool' => [
            'min_connections' => 1,
            'max_connections' => 20,
            'connect_timeout' => 8.0,
            'wait_timeout' => 6.0,
            'heartbeat' => -1,
            'max_idle_time' => (float) env('MONGODB_MAX_IDLE_TIME', 60),
        ],
    ],
];
